package initial

import (
	"github.com/astaxie/beego"
	"github.com/duguying/ojsite/judger"
)

// connect judger and login
func InitJudger() {
	host := beego.AppConfig.String("judgerhost")
	port, err := beego.AppConfig.Int("judgerport")
	pass := beego.AppConfig.String("judgerpass")

	if err != nil {
		port = 1004
	}

	judger.ConnectJudger(host, port, pass)
}
